package com.xhsj.user.sms.purchase.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xhsj.user.sms.purchase.entity.TbPurchaseOrderFile;
import com.xhsj.user.sms.purchase.vo.DistributionDocumentsPageListQueryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购订单-采购相关文件 Mapper 接口
 * </p>
 *
 * @author suxiaolin
 * @since 2020-04-23
 */
@Mapper
public interface TbPurchaseOrderFileMapper extends BaseMapper<TbPurchaseOrderFile> {

    /**
     * 通过订单id和type查询订单相关文件
     * @author 苏小林
     * @date 2020/4/28 16:07
     * @param: id
     * @param: type
     * @return: java.util.List<com.xhsj.user.sms.purchase.entity.TbPurchaseOrderFile>
     */
    List<TbPurchaseOrderFile> getOrderFileByOrderId(@Param("id") String id, @Param("type") Integer type);

   //供应链部领导下发给成员编制采购文件页面
    List<DistributionDocumentsPageListQueryVo> distributionDocumentsPage(@Param("dataId") String dataId, @Param("nodeId") String nodeId);

    //删除合同相关得文件
    int removeOrderFile(@Param("purchaseApplyId") String purchaseApplyId,
                        @Param("dataId") String dataId,
                        @Param("nodeId") String nodeId,
                        @Param("type") Integer type);

    void delByOrderId(@Param("id") String id);

    //采购订单-采购相关文件
    List<Map<String, Object>> getPurchaseOrderFileList(@Param("dataId") String dataId,
                                                       @Param("typeList") List<String> typeList,
                                                       @Param("nodeList") List<String> nodeList);
}
